<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>腾飞健康管理平台</title>
    <link rel="stylesheet" href="lib/layui/css/layui.css">
</head>
<body>
<div class="layui-row">
    <div class="layui-input-inline layui-col-md5">
        <input type="text" name="searchInput" class="layui-input" placeholder="请输入项目名称或编号">
    </div>
    <div class="layui-input-inline">
        <button class="layui-btn" name="search">搜索</button>
    </div>
</div>
<table id="labItemTable" lay-filter="labItemTable"></table>
<script type="text/javascript" src="lib/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(["jquery", "table"], function () {
        let $ = layui.jquery;
        let table = layui.table;

        let labItemTable = table.render({
            elem: "#labItemTable",
            id: "labItemTableId",
            url: "/",
            page: true,
            limit: 5,
            limits: [5, 10, 15],
            method: "post",
            size: "sm",
            toolbar: true,
            toolbar: "#toobarTemplet", //表格头部工具栏模板
            response: {
                countName: "totalCount",
                dataName: "data",
                msgName: "msg",
            },
            request: {
                pageName: "currentPageNum",
                limitName: "pageSize",
            },
            cols: [
                [
                    {type: "checkbox", fixed: "left", align: "center"},
                    {field: "examineItemId", title: "编号", width: 100, sort: true, align: "center"},
                    {field: "itemName", title: "名称", width: 150, align: "center"},
                    {title: "操作", width: 100, fixed: "right", templet: "#operateTemplete", align: "center"}
                ]
            ]
        });
    });
</script>
<script type="text/html" id="toobarTemplet">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="batchDelete">批量删除</button>
        <button class="layui-btn layui-btn-sm" lay-event="addLabItem">添加项目</button>
    </div>
</script>
</body>
</html>